home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java for 3D & VRML Worlds
/
Java for 3d and VRML Worlds.iso
/
world
/
handwriting
/
switch1.java
< prev
Wrap
Text File
|
1996-10-17
|
818b
|
73 lines
// "Handwriting Effect"
// created by ask@krc.sony.co.jp (Masamichi zzzcat Asukai)
//
// Copyright(C) 1996 Sony Corporation. All rights reserved.
//
import vrml.*;
import vrml.node.*;
import vrml.field.*;
public class switch1 extends Script {
private SFInt32 setSwitch;
private int childNo;
private int Nchild;
public void initialize(){
setSwitch = (SFInt32) getEventOut("setSwitch");
childNo = 0;
Nchild = 20;
}
public void processEvent(Event e) {
if (e.getName().equals("interval")) {
++childNo;
if (childNo >= Nchild) {
childNo = 0;
}
// change the visible child of Switch node.
setSwitch.setValue(childNo);
}
}
}